package ochart.renders.vector.elements.bars
{
	import ochart.core.XYChart;
	import ochart.elements.axes.XAxis;
	import ochart.elements.bars.Bar;
	import ochart.elements.bars.BarBase;

	public class BarRenderer extends BarBaseRenderer
	{
		public function BarRenderer()
		{
			super();
		}
		
		override public function render():Boolean
		{
			if(!super.render())
			{
				return false;
			}
			
			var bar:Bar = target as Bar;
			if(!isNaN(bar.color))
			{
				bar.graphics.beginFill(bar.color);
				bar.graphics.drawRect(0, 0, bar.width, bar.height);
				bar.graphics.endFill();
			}
			
			return true;
		}
	}
}